;
; eSoft, Inc.
;
; TBBS Sample System #2
; MACROS (SDL) Source Code
;
; created by: Karl E. Glasgow IV
;***************************************************************************
;****** WE RECOMMEND YOU PRINT THIS FILE IN ITS ENTIRETY FOR REVIEW ******
;***************************************************************************
; --------------------------------------------------------------------------
; THIS IS THE SDL (SYSTEM DEFINITION LANGUAGE) SOURCE CODE THAT CONTAINS
; THE MACROS USED IN SAMPLE MENU SYSTEM #2. THE COMMENTS IN THIS FILE
; EXPLAIN EACH PART AND ITS PURPOSE.
;
; IF YOU SIMPLY WISH TO ADD OR EDIT A MENU OPTION, OR CREATE A NEW MENU,
; YOU MOST LIKELY WILL NOT NEED TO MODIFY THESE MACROS. REFER TO THE
; "MENU.SDL" FILE INSTEAD.
;
; BY READING THROUGH THE COMMENTS IN THIS FILE FROM START TO FINISH, YOU
; CAN GAIN ENOUGH UNDERSTANDING TO ALLOW YOU TO MAKE CHANGES TO THESE MACROS
; WITH THE MINIMUM OF EFFORT.
;
; REMEMBER! IF YOU MAKE CHANGES TO THESE MACROS YOU MUST RECOMPILE THE
; MENU SOURCE CODE SO THAT YOUR CHANGES TAKE AFFECT. TO
; RECOMPILE, DO THE FOLLOWING:
;
; FROM THE "C:\TBBS\MENU" DIRECTORY, TYPE "SDL MENU" AND HIT <ENTER>.
; --------------------------------------------------------------------------
; INTRODUCTION:
; --------------------------------------------------------------------------
;
; For more information on what Macros are as well as when and how they're
; used, see Chapter 7 of your TBBS reference manual. The discussion on
; Macros begins on page 7-8.
; USE OF MACROS WITHIN THIS SDL CODE:
; --------------------------------------------------------------------------
; This SDL source code uses a large number of MACROS. They are
; designed to make simple alterations and creation of new menus
; easy for you. Each macro used here is explained prior to its
; definition, in MACRO DEFINITIONS. You are encouraged to make full
; use of these macros when adding new options and menus to this
; code. It is important to note that macros are NOT required in
; SDL -- they can be, however, very helpful.
; USE OF ANSI WITHIN THIS SDL CODE:
; --------------------------------------------------------------------------
; Nearly all display text contained within this code incorporates
; ANSI sequences which provide cursor-movement/positioning as well
; as foreground/background color. Most of these sequences have
; been used within MACROS, so that you can add functionality to
; your system and make minor changes to text/color displays without
; having to deal with ANSI sequences themselves directly (or
; understand their syntax).
;
; If you would like to view or alter these ANSI color macros, they
; can be found in a separate file called "COLORS.SDL".
;
; IMPORTANT NOTE:
;
; ** If you are not familiar with ANSI sequences and their meanings,
; it is highly recommended that you not attempt to make direct
; alterations to them until you fully understand them.
; ANSI is an industry standard and is fairly well-documented.
;
; For a listing of those ANSI codes supported by TBBS, refer to
; page 2-32 through 2-34 of the TBBS (Information Manager) manual.
; MACRO DEFINITIONS:
; (MACROS USED WITHIN THIS CODE, EXPLAINED)
; --------------------------------------------------------------------------
; Macros are commands and strings of text which have been assigned
; to a name, and can therefore be referred to later by that name.
; This way, a long string of commands or text which is to be repeated
; in your menu system can be referenced by a much smaller macro name --
; saving you time and effort.
;
; To create a macro, you can use either the Macro: and EndMacro:
; commands (for defining large amounts of data), or you can use
; the Equate: command (for short strings of data).
;
; To call a macro, simply use an at sign "@" followed by the macro
; name it has been assigned to.
;
; For more information on what macros are and how they work, please
; refer to Chapter 7 of your TBBS manual, starting with page 7-8
; before proceeding.
; This macro is used to control where text is displayed on the screen.
; To use this macro, use the following syntax:
;
; @CPOS(row,column)
;
Equate: CPOS = [%1;%2H
; This macro displays the contents of a file (presumably a file
; containing an ANSI background image), and then paints a menu title
; overtop of it in the appropriate color.
;
Macro: TITLE
Entry: {%1}
Entry:
@YELLOW+@BCKBLK+@CPOS(1,25)@BBSNAME
Entry:
@BLACK+@BCKWHT+@CPOS(3,23) %2 @BRTWHT+@BCKBLK+├
Endtext:
Endmacro:
; The OPTIONS macro is referred to by each of the OPTION macros.
; It is used so that you can change many things about the way a menu
; entry is displayed by altering just this one macro, instead of
; having to change all eight of the OPTION macros (found next).
;
; This moves to a specific line on the screen and the 22nd column,
; and then displays a "<", the specified hotkey letter, and another
; ">" (all in the appropriate colors to blend in with the ANSI
; menu background).
;
; --------------------------------------------------------------------------
; NOTE: If you wanted to change the separaters used here from "< >" to
; something like "[ ]", you would change the OPTIONS macro to read:
;
; @CPOS(%1,22)@BCKBLK+@WHT+[@YELLOW+%2@WHT+]@BRTGRN+ %3
; ^ ^
; If you then wanted to change the color of the highlighted hotkey to
; bright cyan instead of yellow, you would alter OPTIONS to read:
;
; @CPOS(%1,22)@BCKBLK+@WHT+[@BRTCYN+%2@WHT+]@BRTGRN+ %3
; ^
; --------------------------------------------------------------------------
;
Macro: OPTIONS
@CPOS(%1,22)@BCKBLK+@WHT+<@YELLOW+%2@WHT+>@BRTGRN+ %3
Endmacro:
; The GLOBALS macro performs the same function as the OPTIONS macro
; above, except that it is used by the GLOBAL macros that display
; options at the bottom of each menu. They are defined separately
; only for organizational reasons -- they work exactly the same.
;
Macro: GLOBALS
@CPOS(%1,22)@BCKBLK+@WHT+<@YELLOW+%2@WHT+>@BRTGRN+ %3
Endmacro:
; The OPTION macros defined below display the hotkey and text
; description for each of your menu entries. OPTION1 displays the
; first menu option, OPTION2 displays the second, and so on.
;
; These macros use the OPTIONS macro (see last macro definition) to
; do all the real work. Here we simply specify which line the option
; should appear on. Because of the design of the ANSI menu background
; used in this sample menu system, a maximum of 7 menu items can
; appear in any one menu.
;
; NOTE: It is important to note that this is NOT a limitation of the
; TBBS menuing system, and you can create your own menus that have as
; many options as you wish.
;
Equate: OPTION1 = @OPTIONS(5,%1,%2)
Equate: OPTION2 = @OPTIONS(6,%1,%2)
Equate: OPTION3 = @OPTIONS(7,%1,%2)
Equate: OPTION4 = @OPTIONS(8,%1,%2)
Equate: OPTION5 = @OPTIONS(9,%1,%2)
Equate: OPTION6 = @OPTIONS(10,%1,%2)
Equate: OPTION7 = @OPTIONS(11,%1,%2)
Equate: OPTION8 = @OPTIONS(12,%1,%2)
; These GLOBAL macros work just like the OPTION macros above, except
; that they display options which appear inside the "Global Commands"
; section of the ANSI menu background we've used. Up to 3 of these
; "Global" options can be used in these sample menus.
;
Equate: GLOBAL1 = @GLOBALS(15,%1,%2)
Equate: GLOBAL2 = @GLOBALS(16,%1,%2)
Equate: GLOBAL3 = @GLOBALS(17,%1,%2)
; This macro resets the color and the cursor position so that the
; "Command:" prompt appears below the menu and in the desired
; color.
; --------------------------------------------------------------------------
; NOTE: The actual text "Command:" is not contained here, but can
; be found instead in the TBBS language file. The EDLANG editor is
; used to view and edit the language file. It is discussed in the
; TBBS reference manual in Chapter 2 on page 2-28.
; --------------------------------------------------------------------------
;
Macro: COMMAND
Entry:
@BRTWHT+@BCKBLK+@CPOS(21,1)~
Endtext:
Endmacro: